<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\assets\AppAsset;
use kartik\file\FileInput;

/* @var $this yii\web\View */

AppAsset::register($this);
AppAsset::addScript($this,'@web/js/list/jquery/jquery.form.js');

$this->title = 'A-PMS项目管理系统';

?>
    <!--中心内容区-->
    <div class="container content">
        <div class="row">
            <div class="content-left pull-left col-md-2">
                <div class="list-group ">
                    <a href="#" class="list-group-item active">
                        <img src="images/image/officeHall/uploadAssetPackage/upload.png" class="pull-left"><span>上传基本信息</span>
                    </a>
                    <a href="#" class="list-group-item">
                        <img src="images/image/officeHall/uploadAssetPackage/new.png" class="pull-left"><span>我的新建记录</span></a>
                </div>
            </div>

            <div class="content-right pull-right">
                <div class="upLoadInformation">
                    <span></span>
                    <p>上传基本信息</p>
                </div>
                <div class="loadState">
                    <img src="images/image/officeHall/uploadAssetPackage/loadState2.png" alt=""/>
                </div>

                <!--//导入债务人清单-->
                <div class="importDebtorBox">
                    <div class="upLoadList">
                        <div class="upLoadListBtn xy" align="center">
                            <img src="images/image/officeHall/uploadAssetPackage/upLoadListBtn.png" class="upload_excel" alt="点击上传"/>
                            <p>上传清单</p>
                        </div>
                        <!--<input type="file"  class="upload"/>-->
                        <div class="text">
                            <p>1.仅支持模板文件上传；</p>
                            <p>
                                2.点击下载<a href="index.php?r=package/download">资产包债务清单上传模板.xlsx</a>补充并上传。
                            </p>
                        </div>
                    </div>

                    <div class="lastNextStep">
                        <button type="button" class="btn nextStep btn-primary  active pull-right">下一步</button>
                        <button type="button" class="btn lastStep pull-right">上一步</button>
                    </div>
                </div>


                <!--//清单列表(三种状态)-->
                <div class="importDebtorList">
                    <div class="box">
                        <ul class="clearfix">
                            <li class="pull-left ">
                                <img src="images/image/officeHall/uploadAssetPackage/uploading.png"
                                     title="江苏资少时诵诗书所所所所所所所所所所所所所所所所所所所所所所所所所产455.xlsx"
                                     alt="江苏资少时诵诗书所所所所所所所所所所所所所所所所所所所所所所所所所产455.xlsx"/>
                                <p>江苏资少时诵诗书所所所所所所所所所所所所所所所所所所所所所所所所所产455.xlsx</p>
                            </li>

                            <li class="pull-left">
                                <img src="images/image/officeHall/uploadAssetPackage/uploadFilure.png"
                                     title="江苏资产.xlsx" alt=""/>
                                <p>江苏资产.xlsx</p>
                            </li>

                            <li class="pull-left">
                                <img src="images/image/officeHall/uploadAssetPackage/uploadSuccessfully.png"
                                     alt="" title="江苏资产.xlsx"/>
                                <p>江苏资产.xlsx</p>
                            </li>

                            <li class="pull-left">
                                <img src="images/image/officeHall/uploadAssetPackage/uploadFilure.png"
                                     title="江苏资产.xlsx" alt=""/>
                                <p>江苏资产.xlsx</p>
                            </li>

                            <li class="pull-left">
                                <img src="images/image/officeHall/uploadAssetPackage/uploadSuccessfully.png"
                                     alt="" title="江苏资产.xlsx"/>
                                <p>江苏资产.xlsx</p>
                            </li>

                            <!--<li class="pull-left ListUpLoadListBtn">
                                <img title="单击继续上传" class="upload_excel"
                                     src="images/image/officeHall/uploadAssetPackage/upLoadListBtn.png"/>

                            </li>-->


                           <!-- <a href='javascript:;' class="upload">上传</a>
                            <div style="display:none"><input type="xlsFile" id="upload" name="UploadForm[file]" /></div>  这个name很重要
                            <img data-name="img" src="blank.gif" />-->

                            <?php $form = ActiveForm::begin([
                                'action' => ['package/upload'],
                                'method' => 'post',
                                'id' => 'myupload',
                                'options' => [
                                    'enctype' => 'multipart/form-data' //文件上传时添加该编码
                                ]
                            ]); ?>

                            <li class="pull-left ListUpLoadListBtn">
                                <img title="单击继续上传" class="upload_excel"
                                     src="images/image/officeHall/uploadAssetPackage/upLoadListBtn.png"/>

                                <?= $form->field($upload, 'xlsFile')->fileInput() ?>

                                <!-- <input type="hidden" name="package_id" value="<?php /* echo $model->id;*/?>"/>-->
                            </li>

                            <!--<button>Submit</button>-->

                            <?php ActiveForm::end() ?>

                        </ul>
                        <div class="text">

                            <p class="defeatedWaring">
                                <!--<span class="defeatedWaring"></span>-->
                                <span>江苏资产清单.xlsx</span>
                                <span>上传失败:文件格式与要求不符,请下载模板完善上传。</span>


                            <p class="defeatedWaring">
                                <!--<span class="defeatedWaring"></span>-->
                                <span>江苏资产清单.xlsx</span>
                                <span>上传失败:文件格式与要求不符,请下载模板完善上传。</span>
                            </p>

                            <p class="promptOne">
                                1. 仅支持模板文件上传;
                            </p>
                            <p class="promptTwo">
                                2.点击下载<a href="index.php?r=package/download">资产包债务清单上传模板.xlsx</a>补充并上传。
                            </p>

                        </div>
                    </div>
                    <div class="lastNextStep">
                        <button type="button" class="btn nextStep btn-primary  active pull-right">下一步</button>
                        <button type="button" class="btn lastStep pull-right">上一步</button>
                    </div>
                </div>
            </div>
        </div>
    </div>


<?php
$js = <<<JS
$(function() {
    $('.importDebtorBox').show();    
    //$('.importDebtorBox').hide();    
   
    $("#uploadform-xlsfile").change(function () {
        $("#myupload").ajaxSubmit({
            dataType: 'json',
            success: function (data) {
                //$("#pic").attr("src", "../../uploads/up_face/" + data);
            },
            error: function (xhr) {
                alert("上传失败！\n 图片格式为gif ， jpg 或  png类型！ \n 图片大小小于2MB！");
            }
        });
    });
    
});

JS;
$this->registerJs($js);